package com.fms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fms.entity.WarehouseBoard;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface WarehouseBoardMapper extends BaseMapper<WarehouseBoard> {
    @Update("UPDATE warehouse_board SET board_amount = board_amount - #{amount} WHERE id = #{id}")
    void updateWarehouseBoardOutAmount(Integer amount, Long id);
    @Update("UPDATE warehouse_board SET board_amount = board_amount + #{addBoardAmount} WHERE id = #{id}")
    void rollbackAmount(Integer addBoardAmount, Long id);
}
